package com.dk.fectory;

import com.dk.pojo.CodePart;
import com.dk.service.CodeService;
import org.springframework.stereotype.Component;

/**
 * @author zh
 * @Description TODO
 * @createTime 2023/4/20
 */
@Component
@CodeType(codeType = "SERIALNO")//流水号
public class SERIALNO implements CodeService {

    @Override
    public String code(CodePart codePart) {
        if (codePart.getSeriaNowNo()==null || codePart.getSeriaNowNo().equals("")){
            int i = codePart.getSeriaStartNo() + codePart.getSeriaStep();
            return ""+i;
        }
        int i = codePart.getSeriaNowNo() + codePart.getSeriaStep();
        return ""+i;
    }
}
